<!DOCTYPE html>
<html lang="en">

<head>
    <#include "/lx/admin/components/meta.html" />
    <title>页面访问统计 ${metaTitleSuffix!}</title>
    <#include "/lx/admin/components/stylesheets.html" />
</head>

<body>
    <div id="app">
        <el-container>
            <#assign menuIndex="6-1" />
            <#include "/lx/admin/components/menu.html" />
            <el-container>
                <#include "/lx/admin/components/header.html" />
                <el-main>
                    <template>
                        <el-row>
                            <el-col :span="12">
                                <div class="title theme-color1">页面访问统计</div>
                            </el-col>
                        </el-row>
                        <div class="search">
                            <el-date-picker v-model="dateRange" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" unlink-panels="true" :default-value="new Date">
                            </el-date-picker>
                            <el-button @click="onSearch"><i class="el-icon-search"></i>筛选</el-button>
                        </div>
                        <el-table ref="multipleTable" :data="list" tooltip-effect="dark" style="width: 100%" default-expand-all>
                            <el-table-column type="expand">
                                <template slot-scope="props">
                                    <el-form label-position="left" inline>
                                        <el-form-item label="大学详情">
                                            <span>{{ props.row.schoolVisit }}</span>
                                        </el-form-item>
                                        <el-form-item label="课程详情">
                                            <span>{{ props.row.majorVisit }}</span>
                                        </el-form-item>
                                        <el-form-item label="政策详情">
                                            <span>{{ props.row.policyVisit }}</span>
                                        </el-form-item>
                                        <el-form-item label="常见问题">
                                            <span>{{ props.row.questionVisit }}</span>
                                        </el-form-item>
                                    </el-form>
                                </template>
                            </el-table-column>
                            <el-table-column prop="school.name" label="英国大学名称" show-overflow-tooltip>
                            </el-table-column>
                            <el-table-column prop="school.subscribes" label="订阅人数" show-overflow-tooltip>
                            </el-table-column>
                        </el-table>
                    </template>
                </el-main>
            </el-container>
        </el-container>
        <#include "/lx/admin/components/footer.html" />
    </div>
    <#include "/lx/admin/components/scripts.html" />
    <script>
        var vue = new Vue({
        el: '#app',
        data() {
            return {
                list: [],
                dateRange: ''
            }
        },
        mounted: function() {
            var startTime = '${startTime!""}'
            if (startTime != '') {
                this.dateRange = new Array;
                this.dateRange.push('${startTime!}');
                this.dateRange.push('${endTime!}');
            }
        },
        methods: {
            onSearch() {
                var self = this;
                var keys = [];
                if (self.dateRange != null && self.dateRange.length > 1) {
                    keys.push({ key: 'startTime', value: self.dateRange[0] });
                    keys.push({ key: 'endTime', value: self.dateRange[1] });
                } else {
                    keys.push({ key: 'startTime', value: '' });
                    keys.push({ key: 'endTime', value: '' });
                }
                goPage(1, keys);
            }
        }
    })
    </script>
    <script>
        vue.list = ${info!'[]'}
    </script>
    <#include "/lx/admin/components/msg.html" />
    <style type="text/css">
    .title {
        font-size: 18px;
        font-weight: bold;
    }

    .operations {
        text-align: right;
    }

    .search {
        margin-top: 10px;
    }
    </style>
</body>

</html>